The present disclosure generally relates to integrated circuits, and more particularly, to integrated circuits for executing external programs codes.
Integrated circuit designers often choose processors and application specific integrated circuits (ASIC) for different design considerations in the product development process, for example, performance, flexibility, time to market. Generally speaking, ASIC are designed to perform only specific functions and possess a better performance than processors. On the other hand, processors may perform more diversified functions by modifying the firmware or software and keeping the hardware unchanged. Therefore, processors provide the designers a shorter product development cycle and more flexibility.
Processors are also known as microprocessors, controllers, micro-controllers, etc. Processors may load program codes from non-volatile memories and execute the loaded program codes for performing certain functions. The non-volatile memory, e.g., read only memory (ROM) and flash memory, may be built in the processor for storing the program codes. When the product functions need to be modified or supplemented, the programs code, i.e., the stored content of the non-volatile memory, should be modified or supplemented. New masks may be needed for modifying the non-volatile memories built in the processors, and therefore consume lots of money and elongate the development time.
Alternatively, the modified or supplemented program codes are stored in the external non-volatile memory. The processor may load and execute the program codes stored both in the internal non-volatile memory and in the external memory. The designers may modify or supplement the programs codes with more flexibility and lower cost. Therefore, the collaboration among different designers may be easily achieved and the product development may be expedited.
Moreover, some processors support the data overlay function (also known as the memory sharing function) so that different routines may share the same random access memory (RAM) and the requirement for RAM may be lowered. For example, routines A and B need 30 and 20 memory units in the RAM for accessing (reading and/or writing) data, respectively. When the processors do not support the data overlay function, 50 memory units are needed even if routines A and B are not executed concurrently. On the contrary, when the processors support the data overlay function, 30 memory units may be enough if routines A and B are not executed concurrently. Routines are also known as sub-routine, programs, sub-programs, processes, etc. The memory unit may be bit, byte, word, or other suitable memory size.
When using the processors with data overlay function to execute the program codes stored in the external non-volatile memory, routine scheduling and RAM allocation should be carefully designed to prevent the routines from accessing the wrong data and causing erroneous result. For example, the designer may substitute the routine A above with a routine C stored in the external memory, and the routine C, however, needs 40 memory units for accessing data. Suppose that the N to N+29 memory units and the N+30 to N+45 memory units in the RAM are assigned to routine A and D, respectively. Besides, the routines A and D may be executed concurrently. If the designer substitutes the routine A with the routine C directly, the routine C will use the N to N+39 memory units in the RAM for accessing data. The routines C and D, therefore, may access the same memory units, i.e., the N+30 to N+39 memory units and cause erroneous result.
Therefore, the integrated circuit designers need an easier approach for dealing with the modification and supplement of the program codes for the processors with the data overlay function.